//
//  WorkDetalFooterView.m
//  WULIHH
//
//  Created by tang on 16/4/18.
//  Copyright © 2016年 tang. All rights reserved.
//

#import "WorkDetalFooterView.h"
#import "Header.h"



@interface WorkDetalFooterView ()
{
    UIButton *starNameLable;
    UIButton *chonggouButton;
    UIButton *shareButton;
    UIButton *favButton;
    UILabel *labelname;
    
}

@end


@implementation WorkDetalFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self initUI];
    }
    return self;
}




- (void)initUI
{
    
    UIImage *image = nil;
    image = [UIImage imageNamed:@"btn-shape"];
    starNameLable = [[UIButton alloc] initWithFrame:CGRectMake(8, 0, image.size.width, image.size.height)];
    [starNameLable setImage:image forState:UIControlStateNormal];
    [starNameLable.titleLabel setFont:[UIFont systemFontOfSize:10.0]];
    [starNameLable addTarget:self action:@selector(LeftstarBtnEvent:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:starNameLable];
    
    labelname = [[UILabel alloc] initWithFrame:CGRectMake(8, 0, image.size.width, image.size.height)];
    [labelname setText:@"#鹿晗"];
    [labelname setTextColor:[UIColor yellowColor]];
    [labelname setFont:[UIFont systemFontOfSize:13.0]];
    [starNameLable addSubview:labelname];
    
    
    image = [UIImage imageNamed:@"chonggou"];
    chonggouButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, image.size.width, 30.0)];
    [chonggouButton setCenter:CGPointMake(WithView/2.0, 15.0)];
    [chonggouButton setImage:image forState:UIControlStateNormal];
    [chonggouButton addTarget:self action:@selector(CenterchonggouEvent:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:chonggouButton];
    
    image = [UIImage imageNamed:@"Star"];
    favButton = [[UIButton alloc] initWithFrame:CGRectMake(WithView-40.0, -3, 30.0, 37.5)];
    [favButton setImage:image forState:UIControlStateNormal];
    [favButton addTarget:self action:@selector(favStar:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:favButton];
    
    image = [UIImage imageNamed:@"Share"];
    shareButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMinX(favButton.frame)-40.0, 0, 30.0, 30.0)];
    [shareButton setImage:image forState:UIControlStateNormal];
    [shareButton addTarget:self action:@selector(shareEvent:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:shareButton];
    
    
}
- (void)LeftstarBtnEvent:(id)sender{
    
    if (_delegate && [_delegate respondsToSelector:@selector(LefterStar)]) {
        [_delegate LefterStar];
    }
    
}
- (void)CenterchonggouEvent:(id)sender{
    
    if (_delegate && [_delegate respondsToSelector:@selector(CenterChougou)]) {
        [_delegate CenterChougou];
    }
    
    
    
}


- (void)shareEvent:(id)sender{
    if (_delegate && [_delegate respondsToSelector:@selector(RightShare)]) {
        [_delegate RightShare];
    }
}
- (void)favStar:(id)sender{
    if (_delegate && [_delegate respondsToSelector:@selector(favStar)]) {
        [_delegate favStar];
    }
    
}

- (void)tianjiaShoucang
{
    [favButton setImage:[UIImage imageNamed:@"Star"] forState:UIControlStateNormal];
}



- (void)deleteShoucang
{
    [favButton setImage:[UIImage imageNamed:@"Star"] forState:UIControlStateNormal];
}




- (void)setNameString:(NSString *)nameString
{
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
